// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {
	vm.$u.api = {
		getconfig:(params ={}) => vm.$u.post('/api/index/getconfig',params),
		// 性格测试题
		character:(params ={}) => vm.$u.post('/api/index/character',params),
		// 性格测试解析
		testParse:(params ={}) => vm.$u.post('/api/index/parse',params,{'Content-Type':'application/json;charset=UTF-8'}),
		// 小程序登录
		appLogin:(params ={}) =>vm.$u.post('/api/index/appLogin',params),
		// 登录测试
		loginTest:(params ={}) =>vm.$u.post('/api/index/loginTest',params),
		// 文章列表
		article:(params ={}) =>vm.$u.post('/api/index/article',params),
		articleDetail:(params ={}) =>vm.$u.post('/api/index/detail',params),
		// 商品分类
		goodsClassify:(params ={}) =>vm.$u.post('/api/index/goodsClassify',params),
		// 商品列表
		goodsList:(params ={}) =>vm.$u.post('/api/index/goods',params),
		goodsDetail:(params ={}) =>vm.$u.post('/api/index/goodsDetail',params),
		
		// 收货地址
		address:(params ={}) =>vm.$u.post('/api/user/address',params),
		addressEdit:(params ={}) =>vm.$u.post('/api/user/addressEdit',params),
		addressDel:(params ={}) =>vm.$u.post('/api/user/addressDel',params),
		addressDefault:(params ={}) =>vm.$u.post('/api/user/addressDefault',params),
		// 用户信息
		userInfo:(params ={}) =>vm.$u.post('/api/user/information',params),
		saveInfo:(params ={}) =>vm.$u.post('/api/user/saveInfo',params),
		bindMobile:(params ={}) =>vm.$u.post('/api/user/bindMobile',params),
		feedback:(params ={}) =>vm.$u.post('/api/user/feedback',params),
		myTeam:(params ={}) =>vm.$u.post('/api/user/team',params),
		// 分享海报
		poster:(params ={}) =>vm.$u.post('/api/user/poster',params),
		// 资金配置
		getCommission:(params ={}) =>vm.$u.post('/api/index/getCommission',params),
		// eb转ib
		eb2ib:(params ={}) =>vm.$u.post('/api/Financial/transform',params),
		withdraw:(params ={}) =>vm.$u.post('/api/Financial/withdraw',params),
		
		//vip
		viprRecharge:(params ={}) =>vm.$u.post('/api/indent/vip',params),
		
		// 充值面额
		recharge:(params ={}) =>vm.$u.post('/api/index/recharge',params),
		// iB充值 根据 面额id
		rechargePay:(params ={}) =>vm.$u.post('/api/indent/recharge',params),
		// 商品购买
		goodsBuy:(params ={}) =>vm.$u.post('/api/indent/buy',params),
		
		// 情感话廊
		commentList:(params ={}) =>vm.$u.post('/api/index/comment',params),
		commentDetail:(params ={}) =>vm.$u.post('/api/index/commentDetail',params),
		commentDel:(params ={}) =>vm.$u.post('/api/user/commentDel',params),
		commentPush:(params ={}) =>vm.$u.post('/api/user/comment',params),
		doLike:(params ={}) =>vm.$u.post('/api/user/like',params),
		doAccept:(params ={}) =>vm.$u.post('/api/user/accept',params),
		
		// 发布金额
		publishList:(params ={}) =>vm.$u.post('/api/index/publish',params),
		
		// banner
		getBanner:(params ={}) =>vm.$u.post('/api/index/banner',params),
		// 课程分类
		courseCate:(params ={}) =>vm.$u.post('/api/index/courseCate',params),
		courseList:(params ={}) =>vm.$u.post('/api/index/course',params),
		// 章节
		courseChapter:(params ={}) =>vm.$u.post('/api/index/chapter',params),
		// 小节
		courseSection:(params ={}) =>vm.$u.post('/api/index/section',params),
		// 详情
		courseDetail:(params ={}) =>vm.$u.post('/api/index/courseDetail',params),
		// 购买
		coursePay:(params ={}) =>vm.$u.post('/api/indent/course',params),
		
		// 活动
		activity:(params ={}) =>vm.$u.post('/api/index/activity',params),
		activityDetail:(params ={}) =>vm.$u.post('/api/index/activityDetail',params),
		activityApply:(params ={}) =>vm.$u.post('/api/user/apply',params),
		// 我的活动
		myActivity:(params ={}) =>vm.$u.post('/api/user/activity',params),
		// 活动签到
		activitySign:(params ={}) =>vm.$u.post('/api/user/sign',params),
		activityUot:(params ={}) =>vm.$u.post('/api/user/departure',params),
		
		// 我的回复
		answerList:(params ={}) =>vm.$u.post('/api/user/answerList',params),
		// 我的提问
		questionList:(params ={}) =>vm.$u.post('/api/user/questionList',params),
		
		// 订单
		orderList:(params ={}) =>vm.$u.post('/api/indent/orderList',params),
		orderDetail:(params ={}) =>vm.$u.post('/api/indent/orderDetail',params),
		confirm:(params ={}) =>vm.$u.post('/api/indent/signFor',params),
		
		// 消息中心
		message:(params ={}) =>vm.$u.post('/api/user/message',params),
		messageRead:(params ={}) =>vm.$u.post('/api/user/read',params),
		clearMessage:(params ={}) =>vm.$u.post('/api/user/clearMessage',params),
		
		// 会员等级
		level:(params ={}) =>vm.$u.post('/api/index/level',params),
		// 统计
		commentStatistics:(params ={}) =>vm.$u.post('/api/index/commentStatistics',params),
		
		
		
		uploadImage:(params ={}) =>vm.$u.post('/api/index/uploadImage',params),
		uploadImageUrl:'/api/index/uploadImage',
		uploadVideo:(params ={}) =>vm.$u.post('/api/index/uploadVideo',params),
		uploadVideoUrl:'/api/index/uploadVideo'
	}
}

export default {
	install
}